﻿using Model;
using QFramework;
using UnityEngine.SceneManagement;

namespace Command
{
    public class HurtPlayerCommand : AbstractCommand
    {
        protected override void OnExecute()
        {
            var playerModel = this.GetModel<IPlayerModel>();
            playerModel.Hp.Value--;

            if (playerModel.Hp.Value <= 0) SceneManager.LoadScene("GameOver");
        }
    }
}